Skip to content

SuspensionHost class

Attributes: [DebuggerDisplay("AppStateValue = {_appState}")]

Defined in

Namespace: ReactiveUI.Reactive Assembly: ReactiveUI.Reactive.dll Full name: ReactiveUI.Reactive.SuspensionHost<T> Modifiers: public

Summary

View source

Default strongly-typed implementation of ISuspensionHost.

Applies to

net10.0, net10.0-maccatalyst26.0, net10.0-desktop1.0, net10.0-browserwasm1.0, net10.0-tvos26.0, net10.0-windows10.0.19041, net10.0-macos26.0, net10.0-ios26.0, net10.0-android36.0, net9.0, net9.0-tvos18.0, net9.0-macos15.0, net9.0-maccatalyst18.0, net9.0-windows10.0.19041, net9.0-ios18.0, net9.0-desktop1.0, net8.0, net8.0-windows10.0.19041, net8.0-ios18.0, net8.0-maccatalyst18.0, net8.0-macos15.0, net8.0-tvos18.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.5, netstandard2.1, net481, net462, net471

Class hierarchy
classDiagram
class SuspensionHost~T~
class ReactiveObject
ReactiveObject <|-- SuspensionHost~T~
class ISuspensionHost~TAppState~ {
    <>
}
ISuspensionHost~TAppState~ <|.. SuspensionHost~T~
class ISuspensionHost {
    <>
}
ISuspensionHost <|.. SuspensionHost~T~
class IReactiveObject {
    <>
}
IReactiveObject <|.. SuspensionHost~T~
class INotifyPropertyChanged {
    <>
}
INotifyPropertyChanged <|.. SuspensionHost~T~
class INotifyPropertyChanging {
    <>
}
INotifyPropertyChanging <|.. SuspensionHost~T~
class IEnableLogger {
    <>
}
IEnableLogger <|.. SuspensionHost~T~
class IDisposable {
    <>
}
IDisposable <|.. SuspensionHost~T~

Inherits from: ReactiveObject

Implements: ISuspensionHost, ISuspensionHost, IReactiveObject, INotifyPropertyChanged, INotifyPropertyChanging, IEnableLogger, IDisposable

Remarks

This implementation provides settable lifecycle observables and a strongly-typed AppStateValue.

The legacy ISuspensionHost members AppState and CreateNewAppState are implemented explicitly to preserve compatibility with existing infrastructure. The explicit implementations project to/from the typed properties.

Type safety: if a consumer sets AppState to a value not assignable to TAppState, the implementation throws an InvalidCastException.

Constructors

NameSummary
.ctorInitializes a new instance of the [SuspensionHost](# class.

Properties

NameSummary
IsLaunchingNewGets or sets the observable which signals when the application is launching new.
IsResumingGets or sets the observable which signals when the application is resuming from a suspended state.
IsUnpausingGets or sets the observable which signals when the application is activated / unpausing.
IsContinuingGets or sets an observable which signals when the application is continuing from a temporarily paused state.
ShouldPersistStateGets or sets the observable which signals when the application should persist its state to disk.
ShouldInvalidateStateGets or sets the observable which signals that the saved application state should be deleted.
CreateNewAppStateTypedGets or sets a function that can be used to create a new application state instance.
AppStateValueGets or sets the current application state.
AppStateValueChangedGets an observable that signals when [AppStateValue](# is assigned.

Methods

NameSummary
DisposePerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Inherited members